# 组件应用示例：src\views\TerminalsView.vue
from flask import Flask

# from element_sci_api.components.terminal.terminal import pty_mgr, register_websocket_handlers
from element_sci_api import TerminalTabComponent

def print_routes(app):
    with app.test_request_context():
        print("Available routes:")
        for rule in app.url_map.iter_rules():
            print(f"{rule.endpoint}: {rule.rule}")


app = Flask(__name__)
# 添加终端组件
TerminalTabComponent("terminal-tabs", app, "/api")


if __name__ == "__main__":
    print_routes(app)
    app.run(port=5000, host="0.0.0.0")
